package cn.com.huzo.model.entities.trade;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 发货发令单主记录实体类
 *
 * @author 吴旭
 */
public class DeliveryCommandSheetHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -8915316134271370500L;
    private Long HeaderId;
    private String BillNo;                  // 发货发令单号
    private String SoNo;                    // 主合同号
    private String StyleNo;                 // 款号
    private Long CustomerId;                // 客户ID   
    private String CustomerName;            // 客户
    private Long ResponsibleBy;             // 责任人
    private String ResponsibleByName;
    private Timestamp DateOfDelivery;       // 发货日期
    private String Destination;             // 目的地
    private Long ShippingTypeId;            // 运输方式
    private String ShippingTypeName;
    private Boolean IsAssortedColour;       // 可混色 0: 可 1： 不可
    private Boolean IsAssortedSize;         // 可混码 0: 可 1： 不可
    private Boolean IsNewNoPerDestination;  // 每发货地重新编号
    private Boolean IsNewNoPerColour;       // 每色重新编号
    private String Description;             // 备注

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public String getBillNo() {
        return BillNo;
    }

    public void setBillNo(String BillNo) {
        this.BillNo = BillNo;
    }

    public String getSoNo() {
        return SoNo;
    }

    public void setSoNo(String SoNo) {
        this.SoNo = SoNo;
    }

    public String getStyleNo() {
        return StyleNo;
    }

    public void setStyleNo(String StyleNo) {
        this.StyleNo = StyleNo;
    }

    public Long getCustomerId() {
        return CustomerId;
    }

    public void setCustomerId(Long CustomerId) {
        this.CustomerId = CustomerId;
    }

    public String getCustomerName() {
        return CustomerName;
    }

    public void setCustomerName(String CustomerName) {
        this.CustomerName = CustomerName;
    }

    public Long getResponsibleBy() {
        return ResponsibleBy;
    }

    public void setResponsibleBy(Long ResponsibleBy) {
        this.ResponsibleBy = ResponsibleBy;
    }

    public String getResponsibleByName() {
        return ResponsibleByName;
    }

    public void setResponsibleByName(String ResponsibleByName) {
        this.ResponsibleByName = ResponsibleByName;
    }

    public String getDestination() {
        return Destination;
    }

    public void setDestination(String Destination) {
        this.Destination = Destination;
    }

    public Long getShippingTypeId() {
        return ShippingTypeId;
    }

    public void setShippingTypeId(Long ShippingTypeId) {
        this.ShippingTypeId = ShippingTypeId;
    }

    public String getShippingTypeName() {
        return ShippingTypeName;
    }

    public void setShippingTypeName(String ShippingTypeName) {
        this.ShippingTypeName = ShippingTypeName;
    }

    public Boolean getIsAssortedColour() {
        return IsAssortedColour;
    }

    public void setIsAssortedColour(Boolean IsAssortedColour) {
        this.IsAssortedColour = IsAssortedColour;
    }

    public Boolean getIsAssortedSize() {
        return IsAssortedSize;
    }

    public void setIsAssortedSize(Boolean IsAssortedSize) {
        this.IsAssortedSize = IsAssortedSize;
    }

    public Boolean getIsNewNoPerDestination() {
        return IsNewNoPerDestination;
    }

    public void setIsNewNoPerDestination(Boolean IsNewNoPerDestination) {
        this.IsNewNoPerDestination = IsNewNoPerDestination;
    }

    public Boolean getIsNewNoPerColour() {
        return IsNewNoPerColour;
    }

    public void setIsNewNoPerColour(Boolean IsNewNoPerColour) {
        this.IsNewNoPerColour = IsNewNoPerColour;
    }

    public String getDescription() {
        return Description;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public void setDateOfDelivery(Timestamp DateOfDelivery) {
        this.DateOfDelivery = DateOfDelivery;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getDateOfDelivery() {
        return DateOfDelivery;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof DeliveryCommandSheetHeaderEntity)) {
            return false;
        }

        final DeliveryCommandSheetHeaderEntity that = (DeliveryCommandSheetHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
